home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / B-Business / (c)b3.d64 / word pro 64.c (.txt) < prev    next >
Commodore BASIC  |  2008-11-26  |  5KB  |  166 lines

  1. 100 GOTO400
  2. 110 PRINT" PRESS SPACE BAR WHEN READY"
  3. 120 GETA$:IFA$<>" "THEN120
  4. 130 RETURN
  5. 135 REM ***EDIT ROUTINES***
  6. 140 PRINT"[147]";:FORI=0TO9:IFN+I>CTHENRETURN
  7. 150 PRINTN+I;RIGHT$(A$(N+I),LEN(A$(N+I))-1):NEXT:RETURN
  8. 160 PRINT""CHR$(34)CHR$(34)CHR$(20)""SPC(A+2)"^";
  9. 170 POKE631,29:POKE198,1:RETURN
  10. 180 PRINT"MAX";A;"CHARACTERS/LINE":RETURN
  11. 190 PRINT"[147]"A$" NOT POSIBLE MEMORY FULL":GOSUB110:GOTO900
  12. 210 GETA$:IFA$<>"Y"ANDA$<>"N"THEN210
  13. 220 RETURN
  14. 240 FR=FRE(0)-(FRE(0)<0)*65536:RETURN
  15. 260 REM ***TAPE FILES***
  16. 270 PRINT"[147]NAME OF FILE _____ IF NO NAME HIT":INPUT"   RETURN [223][157][157][157]";A$
  17. 280 IFA$="[223]"THENA$=""
  18. 295 POKE788,49:OPEN1,1,B,A$:RETURN
  19. 300 B=1:GOSUB270:FORI=1TOC:PRINT#1,CHR$(34)+A$(I):NEXT:CLOSE1:GOTO1400
  20. 320 D=-1:GOSUB330:C=C-1:FORI=BTOC:A$(I)=A$(I+1):NEXT:A$(I)="":RETURN
  21. 330 L=L+LEN(A$(B))*D:IFL>.7*YORC=MTHENE=2
  22. 340 RETURN
  23. 350 R=0:D=D+1:IFD>NTHEND=2:IFQ=0THENRETURN REM ***JUSTIFICATION***
  24. 360 IFMID$(A$,D,1)<>" "THENR=1
  25. 370 IFQ=RTHENRETURN
  26. 380 GOTO350
  27. 390 REM ***INITIALIZE PROGRAM***
  28. 400 POKE788,52:PRINT"[147]"CHR$(142):INPUT"MAX LINE LENGHT";A:IFA=0THENA=70
  29. 410 IFA>70THEN400
  30. 430 PRINT"AUTOMATIC CARRIAGE RETURN"
  31. 440 PRINT"BETWEEN POSITION "A-7"AND"A
  32. 450 INPUT"NUMBER OF TABS";T:IFT=0THEN510
  33. 460 IFT>10THENPRINT"[147]";:GOTO450
  34. 470 PRINT"DEFINE TAB POSITIONS"
  35. 480 PRINT"BETWEEN 1 AND "A:PRINT:FORI=1TOT
  36. 490 PRINT"TAB NO.";I;:INPUTT%(I):IFT%(I)>ATHEN490
  37. 500 NEXT
  38. 510 GOSUB240:M=INT(FR/A)+10:Z=INT(.9*M):DIMA$(M):GOSUB240:Y=FR
  39. 515 C=1:D=0:E=0:A$(1)="":GOTO1400
  40. 518 REM *** READ FROM TAPE ***
  41. 520 B=0:GOSUB270
  42. 530 FORC=1TOZ:INPUT#1,A$(C):L=L+LEN(A$(C))
  43. 540 IFST=64THENPRINT"[147]FILE ";A$;"       FOUND[146]":GOSUB110:CLOSE1:GOTO880
  44. 550 IFL>.7*YTHEN870
  45. 560 NEXT:C=C-1:GOTO870
  46. 580 REM *** TEXT WRITING ***
  47. 590 POKE204,1:PRINTCHR$(14)"[147]"A$(C);
  48. 600 GETA$:IFA$=""THEN600
  49. 610 I=ASC(A$)AND127:IFI=13THEN750
  50. 620 IF(D=1ANDA$=" ")ORI=3ORI=17ORI=19ORI=18ORI=29ORI=34THEN600
  51. 630 D=0:IFASC(A$)=133THENPRINT"[147]";:GOTO1400
  52. 640 IFA$=","THENA$=","
  53. 650 IFI=59THENA$=";"
  54. 660 IFA$=";"THENA$=";"
  55. 670 IFA$=":"THENA$=":"
  56. 680 IFI=95THEN830
  57. 690 IFI<>20ANDI<>94THENPRINTA$;:GOTO790
  58. 700 IFLEN(A$(C))=1THEN720
  59. 710 A$(C)=LEFT$(A$(C),LEN(A$(C))-1):PRINTCHR$(20);:GOTO600
  60. 720 A$(C)="":C=C-1:L=L-LEN(A$(C))
  61. 730 IFLEN(A$(C))>39THENPRINT"[146] [157][145]";
  62. 740 PRINT"[146] [157][145]"RIGHT$(A$(C),LEN(A$(C))-1);:GOTO600
  63. 750 IFLEN(A$(C))<=39THENX=225+PEEK(214):POKEX,(PEEK(X)OR128)
  64. 760 PRINT"[146] "CHR$(13);:E=0:L=L+LEN(A$(C))
  65. 770 IFC=ZORL>.8*YTHENPRINT"[147]":GOTO860
  66. 780 C=C+1:A$(C)="":GOTO600
  67. 790 IFE=0ANDLEN(A$(C))>A-7ANDA$=" "THEN820
  68. 800 A$(C)=A$(C)+A$
  69. 810 IFLEN(A$(C))<A+1THEN600.
  70. 820 D=1:GOTO760
  71. 830 FORQ=1TOT:IFPEEK(211)>=T%(Q)-1THENNEXT:GOTO600
  72. 840 P=T%(Q)-PEEK(211)-1:FORW=1TOP:A$(C)=A$(C)+" ":PRINT" ";:NEXT
  73. 850 E=(Q=T)*(T<>1):GOTO600
  74. 860 REM ***DISPLAY/EDIT ROUTINE***
  75. 870 PRINT"[147]MEMORY FULL.":GOSUB110
  76. 880 REM
  77. 890 N=1:INPUT"STARTING LINE#";N:PRINTCHR$(14)
  78. 900 GOSUB140:IFI=0THEN1400
  79. 910 PRINT:PRINT"[195][146]HANGE [196][146]ELETE [201][146]NSERT [204][146]INK"
  80. 920 PRINT"  E[216][146]IT   [198][146]ORWARD  [210][146]EVERSE"
  81. 930 GETA$:IF(A$="R"ANDN>10)ORA$="F"THENN=N+10*(A$="R")-10*(A$="F"):GOTO900
  82. 940 IFA$="X"THEN1400
  83. 950 IFA$=""OR(A$<>"D"ANDA$<>"C"ANDA$<>"I"ANDA$<>"L")THEN930
  84. 960 PRINT""A$
  85. 970 INPUT"[204]INE# ";B
  86. 990 IFB>CORB<0THEN970
  87. 995 IFB=0THEN890
  88. 1000 PRINT"[147]LINE #"B
  89. 1010 IFA$="D"THENGOSUB320:GOTO900
  90. 1020 IFA$="I"GOTO1080
  91. 1030 IFA$="L"THEN1120
  92. 1040 IFE=2THENIFFR<250THENA$="CHANGE":GOTO190
  93. 1050 D=-1:GOSUB330:GOSUB160:PRINTRIGHT$(A$(B),LEN(A$(B))-1);:INPUT"";A$
  94. 1060 IFLEN(A$)>ATHENGOSUB180:GOTO1050
  95. 1070 A$(B)=""+A$:D=1:GOSUB330:GOTO900
  96. 1080 IFE=2THENIFR<300ORC=MTHENA$="INSERT":GOTO190
  97. 1090 FORI=CTOBSTEP-1:A$(I+1)=A$(I):NEXT:C=C+1
  98. 1100 GOSUB160:INPUT"";A$:IFLEN(A$)>ATHENGOSUB180:GOTO1100
  99. 1110 GOTO1070
  100. 1120 FORR=BTOC-1:A$=A$(R):E$=A$(R+1):W=LEN(A$):K=LEN(E$):IFK<2ORW=1THEN900
  101. 1130 IFW>A-7THENNEXT:GOTO900
  102. 1140 IFMID$(E$,2,1)=" "THEN900
  103. 1150 IFK<A-6-WTHEN1180
  104. 1160 FORB=A-5-WTOK-1:IFMID$(E$,B,1)=" "ORB>A+1-WTHEN1190
  105. 1170 NEXT
  106. 1180 A$(R)=A$+" "+RIGHT$(E$,K-1):B=R+1:GOSUB320:NEXTR:GOTO900
  107. 1190 A$(R)=A$+" "+MID$ (E$,2,B-2):IFMID$(E$,B+1,1)=" "THENB=B+1
  108. 1200 A$(R+1)=""+RIGHT$(E$,K-B):NEXTR:GOTO900
  109. 1230 REM *** PRINTER ROUTINE ***
  110. 1240 PRINT"[147]TURN ON PRINTER":GOSUB110:POKE788,49:OPEN4,4,7
  111. 1245 G=0:PRINT"CONFIGURE PRINT ROUTINE?":GOSUB210:IFA$="N"THEN1280
  112. 1250 PRINT"[147]DOUBLE LINE-FEED?":GOSUB 210:S=(A$="Y")
  113. 1260 INPUT"MAX. LINES/PAGE[191][157][157][157]";H
  114. 1270 INPUT"LEFT MARGIN[191][157][157][157]";Q$
  115. 1280 PRINT"JUSTIFICATION?":GOSUB210:B$=A$:D=1:PRINT"[147]":FORI=1TOC:A$=A$(I)
  116. 1285 N=LEN(A$):P=LEN(A$(I+1)):IFB$="N"ORI=CTHEN1340
  117. 1290 IFP<>1THENIFMID$(A$(I+1),2,1)<>" "ANDN>A-7THEN1310
  118. 1300 GOTO1340
  119. 1310 IFN=A+1THEN1340
  120. 1320 Q=1:GOSUB350:Q=0:GOSUB350:IFD=2THEN1320
  121. 1330 A$=LEFT$(A$,D)+" "+MID$(A$,D+1):N=N+1:GOTO1310
  122. 1340 PRINTRIGHT$(A$,N-1):PRINT#4,CHR(16)(Q$)A$:G=G+1:IFS=-1THENPRINT#4
  123. 1350 IFG<>HTHEN1370
  124. 1360 PRINT"[147]MAX.";H;"LINES/PAGE":PRINT"ADJUST PAPER "
  125. 1361 GOSUB110:G=0:PRINT"[147]"
  126. 1370 NEXT:CLOSE4
  127. 1400 POKE788,52:PRINTCHR$(142);"[147]    ***MAIN MENU***
  128. 1410 [153]" [F1] ADD  TEXT
  129. 1420 PRINT" [F2] READ FROM TAPE
  130. 1430 [153]" [F3] REVIEW/EDIT TEXT
  131. 1440 PRINT" [F4] SAVE TEXT ON TAPE
  132. 1450 [153]" [F5] PRINT HARD COPY
  133. 1460 PRINT" [F6] QUIT
  134. 1465 [153]" [F7] INSTRUCTIONS
  135. 1470 GOSUB240:PRINT"   BYTES FREE "FR"[146]":PRINT" SELECT F1-F6"
  136. 1480 GETA$:IFA$=""THEN1480
  137. 1490 IFPEEK(197)<3ORPEEK(197)>6THEN1480
  138. 1500 X=ASC(A$)-132
  139. 1510 ONXGOTO590,890,1240,1550,520,300,1520,1480
  140. 1520 POKE788,49:END
  141. 1540 REM ***INSTRUCTIONS***
  142. 1550 PRINT"[147]WORD PRO[146] IS A SIMPLE EASY TEXT PROCESSOR
  143. 1560 [153]"IT FEATURES:
  144. 1580 PRINT"UP TO 70 CHARACTERS/LINE (MAX.)
  145. 1590 [153]"UP TO 10 TABS
  146. 1595 PRINT"JUSTIFICATION OF RIGHT MARGIN
  147. 1596 [153]"RUN/STOP DISABLED (WITH POKE788,52       NORMAL VALUE IS POKE788,49)
  148. 1600 GOSUB110:PRINT"[147]NOTES WHEN ENTERING TEXT:
  149. 1615 [153]"PRESS '_' FOR TAB
  150. 1617 PRINT"USE RETURN KEY TO START NEW LINE
  151. 1620 [153]"USE INST/DEL FOR CORRECTIONS
  152. 1630 PRINT"CURSOR KEYS DO NOT WORK IN THIS MODE
  153. 1640 [153]"WHEN FINISHED WITH TEXT PRESS [F1]":[141]110
  154. 1650 [153]"LOADREVIEW/EDIT NOTES:
  155. 1655 PRINT"(CURSOR CONTROL KEYS CAN BE USED IN THIS MODE)
  156. 1660 [153]"PRESSING =RESULT
  157. 1670 PRINT"'C'+LINE#=ALLOWS YOU TO EDIT LINE
  158. 1680 [153]"'D'+LINE#=DELETES THAT LINE
  159. 1690 PRINT"'I'+LINE#=INSERTS NEW LINE
  160. 1700 [153]"'L'+LINE#=LINKS THAT LINE AND NEXT LINE  (UP TO MAX LINE LENGHT)
  161. 1710 PRINT"'F'      =DISPLAYS NEXT BLOCK OF TEXT
  162. 1720 [153]"'R'      =DISPLAYS PRECEEDING BLOCK OF   TEXT
  163. 1730 PRINT"'X'      =CONTINUES WITH PROGRAM
  164. 1740 [153]"(NOTE) USE LINE# OF '0' TO ABORT EDITING
  165. 1800 GOSUB110:GOTO1400
  166.